import time
import threading

def singing():
    print("singing线程：", threading.current_thread())
    for i in range(10):
        print("singing 鸡你太美...", i)
        time.sleep(0.5)
        
def dancing():
    print("dancing线程：", threading.current_thread())
    for i in range(10):
        print("dancing 铁山靠...", i)
        time.sleep(0.5)
        
def play_basketball():
    print("playing线程：", threading.current_thread())
    for i in range(10):
        print("playing篮球...", i)
        time.sleep(0.5)
        
if __name__ == '__main__':
    print("主线程:", threading.current_thread())
    t1 = threading.Thread(target=singing, daemon= True)
    t1.start()
    
    t2 = threading.Thread(target=dancing)
    t2.daemon = True
    t2.start()
    
    t3 = threading.Thread(target=play_basketball)
    t3.daemon = False
    t3.start()
    
    time.sleep(2)
    print("主任务完毕,退出")
    exit()
    
    print("-" * 50)
